// 鼠标点击显示隐藏
var tabs = document.getElementsByClassName('tab-head-div')
var contents = document.getElementsByClassName('tab-body-div')
var back = document.querySelector('.tab-head-back');//移动的那个盒子
var boxNum = 7;//7个盒子 
var distance = 100 / boxNum;//移动的距离

for (let i = 0; i < tabs.length; i++) {
    tabs[i].onclick = function () {
        //位移的盒子
        back.style.left = distance * i + '%'
        console.log(i);
        //显示隐藏的切换
        for (var j = 0; j < contents.length; ++j) {
            if (tabs[j] == this) {
                tabs[j].classList.add('current')
                contents[j].classList.add('current')
            } else {
                tabs[j].classList.remove('current')
                contents[j].classList.remove('current')
            }
        }
    }
}
